package com.example.cloud.rabbit;


import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.function.Consumer;

/**
 * mq 消费者
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class MqConsumer {



    @Bean
    public Consumer<Date> sink1() {
        return date -> {
            System.out.println("收到消息" + date);
        };
    }



    @Bean
    public Consumer<LocalDateTime> sink2() {
        return date -> {
            System.out.println("收到消息" + date);
        };
    }
}
